package com.ai.sb.controller;
import com.ai.sb.dto.TaskDto;
import com.ai.sb.model.SbRecord;
import com.ai.sb.service.SbRecordService;
import com.ai.sb.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
* Created by CodeGenerator on 2018/06/09.
*/
@Api(value = "任务,记录管理接口",tags = {"任务，记录管理"})
@RestController
@RequestMapping("/sb/record")
public class SbRecordController {
    @Resource
    private SbRecordService sbRecordService;

    @ApiOperation(value = "点击按钮，包含任务" ,notes = "参数：userId,dicId")
    @PostMapping("addRecord")
    public Result addRecord(@RequestBody SbRecord sbRecord){
        return sbRecordService.addRecord(sbRecord);
    }

    @ApiOperation(value = "查询任务" ,notes = "参数：userId,recordType")
    @PostMapping("selTask")
    public Result selTask(@RequestBody TaskDto taskDto){
        return sbRecordService.selTask(taskDto.getUserId(),taskDto.getRecordType());
    }
}
